<!-- 状态管理 -->
<script>
  import { count, dbCount } from "../stores/index";

  const add = () => {
    console.log("count", count);
    console.log("$count", $count);
    // count.set($count + 1);
    count.update((n) => n + 1);
  };
</script>

<button onclick={add}>加1</button>
<h1>{$count}</h1>
<h1>{$dbCount}</h1>
